/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.ac.iie.di.ban.nmpp.handler;

/**
 *
 * @author alexmu
 */
public class SE2DWWorkerFactory {

    public static SE2DWWorker getSE2DBWroker(TableSe2DWHandler pTableSe2DBHandler, int i) throws Exception {
        SE2DWWorker se2DWWorker = null;
        String dwType = pTableSe2DBHandler.getTableSe2DBRule().getDbType();
        if (dwType.equals("mppcommon")) {
            se2DWWorker = new SE2DWWorkerMpp(pTableSe2DBHandler, dwType);
        } else if (dwType.equals("mppui")) {
            se2DWWorker = new SE2DWWorkerMppUI(pTableSe2DBHandler, dwType);
        } else if (dwType.equals("commonUpdate")) {
            se2DWWorker = new SE2DWWorkercommonUpdate(pTableSe2DBHandler, dwType);
        } else if (dwType.equals("commonUpdateE")) {
            se2DWWorker = new SE2DWWorkercommonUpdateE(pTableSe2DBHandler, dwType);
        }else if (dwType.equals("ocrUpdateE")) {
            se2DWWorker = new SE2DWWorkerocrUpdateE(pTableSe2DBHandler, dwType);
        }else if (dwType.equals("ocrrdUpdateE")) {
            se2DWWorker = new SE2DWWorkerocrrdUpdateE(pTableSe2DBHandler, dwType);
        }else if (dwType.equals("user")) {
            se2DWWorker = new SE2DWWorkeruserInandUp(pTableSe2DBHandler, dwType);
        }else if (dwType.equals("userin")) {
            se2DWWorker = new SE2DWWorkeruserMpp(pTableSe2DBHandler, dwType);
        }else if (dwType.equals("pic")) {
            se2DWWorker = new SE2DWWorkerpicInandUp(pTableSe2DBHandler, dwType);
        } else {
            throw new Exception("unknown dw type " + dwType);
        }
        se2DWWorker.init();
        return se2DWWorker;
    }
}
